#include "alicercejoshua.h"
#include <GL/glu.h>
#include "gllib/Objects.h"

void AlicerceJoshua::draw(){
    glEnable(GL_COLOR_MATERIAL);
    glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

    float mat_specular[] = {0.7, 0.7, 0.7, 1.0};
    float mat_diffuse[] = {1.0, 1.0, 1.0, 0.3};
    float shininess = 5;

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialf(GL_FRONT, GL_SHININESS, shininess);
    glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);

    glPushMatrix();
    desenharBloco();
    desenharEscada();
    desenharVitrine();
    glPopMatrix();

    glDisable(GL_COLOR_MATERIAL);
}

void AlicerceJoshua::desenharBloco(){
    glPushMatrix();
    glColor3f(0.8,0.8,0.8);
    glScalef(1.10,0.2,1.0);
    gllibCube(10);
    glPopMatrix();
}

void AlicerceJoshua::desenharEscada(){
    glPushMatrix();
    glColor3f(0.8,0.8,0.8);
    glScalef(2.5,0.2,1.0);
    glTranslatef(-1.2,-4.0,6.0);
    gllibCube(2);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.8,0.8,0.8);
    glScalef(2.5,0.2,1.0);
    glTranslatef(-1.2,-2.0,5.5);
    gllibCube(2);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.8,0.8,0.8);
    glScalef(2.5,0.2,1.0);
    glTranslatef(-1.2,0.0,5.0);
    gllibCube(2);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.8,0.8,0.8);
    glScalef(2.5,0.2,1.0);
    glTranslatef(-1.2,2.0,4.5);
    gllibCube(2);
    glPopMatrix();
}

void AlicerceJoshua::desenharVitrine(){

    glPushMatrix();
    glColor4f(0.8,0.8,0.8,0.4);
    glScalef(0.5,0.6,0.01);
    glTranslatef(6.0,6.65,500.0);
    gllibCube(10);
    glPopMatrix();

}
